﻿namespace TopHero
{
    public abstract class BaseEntity
    {
        private static int NextVaildId = 1;

        private int _id;

        protected BaseEntity()
        {
            _id = NextVaildId;
            NextVaildId++;
        }

        public int ID()
        {
            return _id;
        }

        internal Vector2 position = Vector2.zero;

        internal abstract void Start();

        internal abstract void Update();

        internal abstract void Destroy();

        internal virtual bool HandleMessage(Telegram telegram)
        {
            return false;
        }

        public Vector2 GetPosition()
        {
            return position;
        }
    }
}